package com.ruoyi.logistic.mapper;

import com.ruoyi.logistic.domain.NetworkBillDetail;
import com.ruoyi.logistic.domain.vo.NetworkBillDetailVo;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.hpsf.Decimal;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.List;

public interface NetworkBillDetailMapper extends  BaseMapper<NetworkBillDetail>{
    List<NetworkBillDetail> search(NetworkBillDetailVo networkBillDetailVo
                                   );
    /*
        网点按日汇总
     */
//    计算收件网点分润/元
    BigDecimal selectNetworkCollectByTime(@Param("startTime")Date startTime,
                                          @Param("endTime")Date endTime);
//    计算业务员分润/元
    BigDecimal selectSalesmanCollectByTime(@Param("startTime")Date startTime,
                                       @Param("endTime")Date endTime);
//    计算总票数
    Integer selectByTotalTicket(@Param("startTime")Date startTime,
                                @Param("endTime")Date endTime);
//    计算业务员分润/元
    Double selectTotalWeightByTime(@Param("startTime")Date startTime,
                                   @Param("endTime")Date endTime);
    /*
        网点按月汇总
     */
    //    计算收件网点分润/元
    BigDecimal selectNetworkCollectByMonth(@Param("startMonth")String startMonth,
                                          @Param("endMonth")String endMonth);
    //    计算业务员分润/元
    BigDecimal selectSalesmanCollectByMonth(@Param("startMonth")String startMonth,
                                            @Param("endMonth")String endMonth);
    //    计算总票数
    Integer selectByTotalTicketByMonth(@Param("startMonth")String startMonth,
                                       @Param("endMonth")String endMonth);
    //    计算业务员分润/元
    Double selectTotalWeightByMonth(@Param("startMonth")String startMonth,
                                    @Param("endMonth")String endMonth);

    /*
        业务员按日汇总
     */
    List<NetworkBillDetail> selectSalesmanByDay(@Param("startTime")Date startTime,
                                                @Param("endTime")Date endTime);
}
